#! /bin/sh

name=libgpg-error
version=1.55
revision=1
tarball_url="https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-${version}.tar.gz"
tarball_blake2b="5d222849c48aba34257f8c402c51318bcdf66a2c485668b852b322763d090b90d0724e2a0d9857f615bb87227d36720b2595593f7727c54688f5ba08c3c8eafc"
imagedeps="build-essential"
hostdeps="gcc pkg-config"
deps="core-libs"

prepare() {
    cp -v src/syscfg/lock-obj-pub.$ARCHITECTURE-unknown-linux-gnu.h src/syscfg/lock-obj-pub.vinix-mlibc.h

    autotools_recursive_regen
}

configure() {
    autotools_configure
}

build() {
    make -j${parallelism} \
        CFLAGS_FOR_BUILD="$HOST_CFLAGS" \
        CXXFLAGS_FOR_BUILD="$HOST_CXXFLAGS" \
        LDFLAGS_FOR_BUILD="$HOST_LDFLAGS"
}

package() {
    DESTDIR="${dest_dir}" make install

    post_package_strip
}
